﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraGrid.Views.Grid.ViewInfo;
    using DevExpress.XtraLayout;
    using DevExpress.XtraLayout.Utils;
    using Microsoft.VisualBasic;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Common.Report;
    using HRM.CORE;
    using HRM.CORE.REPORT;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Security.ERP;

    public class xucReward : Common.xucBase
    {
        private Bar bar1;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarEditItem bbeBeginDate;
        private BarEditItem bbeEndDate;
        private BarButtonItem bbiAddEmployee;
        private BarButtonItem bbiClose;
        private BarButtonItem bbiDelete;
        private SimpleButton bbiDeleteEmployee;
        private BarButtonItem bbiEdit;
        private BarButtonItem bbiExport;
        private BarEditItem bbiFilter;
        private BarButtonItem bbiPrint;
        private BarButtonItem bbiRefresh;
        private SimpleButton bbiSelect;
        private GridColumn colDate;
        private GridColumn colDecideDate;
        private GridColumn colDecideNumber;
        private GridColumn colForm;
        private GridColumn colFoundation;
        private GridColumn colLevel;
        private GridColumn colObject;
        private GridColumn colPerson;
        private GridColumn colReason;
        private GridColumn colRewardCode;
        private GridColumn colSource;
        private GridColumn colStatus;
        private GridColumn colTotalValue;
        private IContainer components = null;
        private GridView gbList;
        private GridControl gcList;
        private GridColumn gridColumn1;
        private GridColumn gridColumn10;
        private GridColumn gridColumn11;
        private GridColumn gridColumn12;
        private GridColumn gridColumn13;
        private GridColumn gridColumn14;
        private GridColumn gridColumn15;
        private GridColumn gridColumn16;
        private GridColumn gridColumn17;
        private GridColumn gridColumn18;
        private GridColumn gridColumn19;
        private GridColumn gridColumn2;
        private GridColumn gridColumn20;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridColumn gridColumn6;
        private GridColumn gridColumn7;
        private GridColumn gridColumn8;
        private GridColumn gridColumn9;
        public DevExpress.Utils.ImageCollection imageCollection2;
        private DevExpress.Utils.ImageCollection imgList;
        private ImageListBoxControl imglsEmployee;
        private LayoutControl layoutControl1;
        private LayoutControlGroup layoutControlGroup1;
        private LayoutControlItem layoutControlItem1;
        private LayoutControlItem layoutControlItem2;
        private LayoutControlItem layoutControlItem3;
        private int m_IndexKey = 1;
        private string m_RewardCode = "";
        private MemoEdit mmDescription;
        private PanelControl panelControl1;
        private RepositoryItemDateEdit repBeginDate;
        private RepositoryItemCalcEdit repCal;
        private RepositoryItemDateEdit repEndDate;
        private RepositoryItemImageComboBox repositoryItemImageComboBox1;
        private RepositoryItemImageComboBox repStatus;
        private RepositoryItemPictureEdit rptPhoto;
        private SplitContainerControl splitContainerControl1;
        private xucSelectEmployees xucSelect;

        public event ClosedHander Closed;

        public xucReward()
        {
            this.InitializeComponent();
            this.InitData();
            this.ReLoad();
        }

        private void Add()
        {
            if (MyRule.IsAdd("bbiReward"))
            {
                xfmRewardAdd add = new xfmRewardAdd(Actions.Add);
                add.Added += new xfmRewardAdd.AddedEventHander(this.frm_Added);
                add.ShowDialog();
            }
        }

        private void AddRow(HRM_REWARD item)
        {
            GridView gbList = this.gbList;
            int focusedRowHandle = gbList.FocusedRowHandle;
            gbList.AddNewRow();
            focusedRowHandle = gbList.FocusedRowHandle;
            gbList.SetRowCellValue(focusedRowHandle, "RewardCode", item.RewardCode);
            gbList.SetRowCellValue(focusedRowHandle, "Foundation", item.Foundation);
            gbList.SetRowCellValue(focusedRowHandle, "Reason", item.Reason);
            gbList.SetRowCellValue(focusedRowHandle, "Object", item.Object);
            gbList.SetRowCellValue(focusedRowHandle, "Form", item.Form);
            gbList.SetRowCellValue(focusedRowHandle, "Level", item.Level);
            gbList.SetRowCellValue(focusedRowHandle, "Source", item.Source);
            gbList.SetRowCellValue(focusedRowHandle, "TotalValue", item.TotalValue);
            gbList.SetRowCellValue(focusedRowHandle, "Status", item.Status);
            gbList.SetRowCellValue(focusedRowHandle, "Date", item.Date);
            gbList.SetRowCellValue(focusedRowHandle, "DecideNumber", item.DecideNumber);
            gbList.SetRowCellValue(focusedRowHandle, "DecideDate", item.DecideDate);
            gbList.SetRowCellValue(focusedRowHandle, "Person", item.Person);
            gbList.UpdateCurrentRow();
        }

        private void bbiAddWork_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.Add();
        }

        private void bbiClose_ItemClick(object sender, ItemClickEventArgs e)
        {
            base.ParentForm.Close();
        }

        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (MyRule.IsDelete("bbiReward"))
            {
                bool flag = false;
                int[] selectedRows = this.gbList.GetSelectedRows();
                if (XtraMessageBox.Show("Bạn c\x00f3 muốn x\x00f3a kh\x00f4ng?", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)
                {
                    string str;
                    object rowCellValue;
                    base.SetWaitDialogCaption("Đang x\x00f3a...");
                    HRM_REWARD hrm_reward = new HRM_REWARD();
                    for (int i = selectedRows.Length; i > 0; i--)
                    {
                        flag = true;
                        rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "RewardCode");
                        if (rowCellValue != null)
                        {
                            SYS_LOG.Insert("Quản L\x00fd C\x00f4ng Việc", "Xo\x00e1", rowCellValue.ToString());
                            str = hrm_reward.Delete(rowCellValue.ToString());
                            if (str == "OK")
                            {
                                this.gbList.DeleteRow(selectedRows[i - 1]);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show("Th\x00f4ng tin kh\x00f4ng được x\x00f3a" + str, "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                    }
                    this.DoHide();
                    if (!flag)
                    {
                        rowCellValue = this.gbList.GetFocusedRowCellValue("RewardCode");
                        if (rowCellValue != null)
                        {
                            SYS_LOG.Insert("Quản L\x00fd C\x00f4ng Việc", "Xo\x00e1", rowCellValue.ToString());
                            base.SetWaitDialogCaption("Đang x\x00f3a...");
                            str = hrm_reward.Delete(rowCellValue.ToString());
                            if (str == "OK")
                            {
                                this.gbList.DeleteRow(this.gbList.FocusedRowHandle);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show("Th\x00f4ng tin kh\x00f4ng được x\x00f3a\r\n" + str, "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                            this.DoHide();
                        }
                    }
                }
            }
        }

        private void bbiDeleteEmployee_Click(object sender, EventArgs e)
        {
            string employeeCode = "";
            employeeCode = this.GetCode(this.imglsEmployee.SelectedItem as ImageListBoxItem);
            try
            {
                HRM_REWARD_EMPLOYEE hrm_reward_employee = new HRM_REWARD_EMPLOYEE();
                if (hrm_reward_employee.Exist(this.m_RewardCode, employeeCode))
                {
                    hrm_reward_employee.Delete(this.m_RewardCode, employeeCode);
                }
                else
                {
                    XtraMessageBox.Show("Kh\x00f4ng thể x\x00f3a nh\x00e2n vi\x00ean n\x00e0y ra khỏi danh s\x00e1ch!");
                }
            }
            catch
            {
            }
            this.LoadFocusedData();
        }

        private void bbiEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.Change();
        }

        private void bbiExport_ItemClick(object sender, ItemClickEventArgs e)
        {
            base._exportView = this.gbList;
            SYS_LOG.Insert("Quản L\x00fd C\x00f4ng Việc", "Xuất");
            base.Export();
        }

        private void bbiFilter_EditValueChanged(object sender, EventArgs e)
        {
            this.m_IndexKey = int.Parse(this.bbiFilter.EditValue.ToString());
            if (this.m_IndexKey == 0)
            {
                this.bbeBeginDate.Enabled = false;
                this.bbeEndDate.Enabled = false;
            }
            else
            {
                this.bbeBeginDate.Enabled = true;
                this.bbeEndDate.Enabled = true;
            }
            this.LoadGrid();
        }

        private void bbiPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            SYS_LOG.Insert("Quản L\x00fd C\x00f4ng Việc", "In");
            if (this.gbList.RowCount > 0)
            {
                rptReward reward;
                xfmReport report = new xfmReport("Sổ Theo D\x00f5i Khen Thưởng");
                if (this.m_IndexKey == 0)
                {
                    reward = new rptReward();
                }
                else
                {
                    reward = new rptReward(System.DateTime.Parse(this.bbeBeginDate.EditValue.ToString()), System.DateTime.Parse(this.bbeEndDate.EditValue.ToString()));
                }
                report.ShowPrintPreview(reward);
            }
        }

        private void bbiRefresh_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.ReLoad();
        }

        private void bbiSelect_Click(object sender, EventArgs e)
        {
            this.xucSelect = new xucSelectEmployees(1, 0);
            this.xucSelect.Dock = DockStyle.Fill;
            this.xucSelect.Selected += delegate (object s, DataTable d) {
                bool flag = false;
                if (XtraMessageBox.Show("Bạn c\x00f3 muốn lưu danh s\x00e1ch nh\x00e2n vi\x00ean được chọn v\x00e0o qu\x00e1 tr\x00ecnh khen thưởng của họ kh\x00f4ng?", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    flag = false;
                }
                else
                {
                    flag = true;
                }
                HRM_REWARD_EMPLOYEE hrm_reward_employee = new HRM_REWARD_EMPLOYEE();
                foreach (DataRow row in d.Rows)
                {
                    if (!hrm_reward_employee.Exist(this.m_RewardCode, row["EmployeeCode"].ToString()))
                    {
                        hrm_reward_employee.Insert(this.m_RewardCode, row["EmployeeCode"].ToString());
                        if (flag)
                        {
                            try
                            {
                                new HRM_PROCESS_REWARD { RewardID = Guid.NewGuid(), EmployeeCode = row["EmployeeCode"].ToString(), Foundation = this.gbList.GetFocusedRowCellValue(this.colFoundation).ToString(), Reason = this.gbList.GetFocusedRowCellValue(this.colReason).ToString(), Form = this.gbList.GetFocusedRowCellValue(this.colForm).ToString(), Date = System.DateTime.Parse(this.gbList.GetFocusedRowCellValue(this.colDate).ToString()), DecideNumber = this.gbList.GetFocusedRowCellValue(this.colDecideNumber).ToString(), Person = this.gbList.GetFocusedRowCellValue(this.colPerson).ToString() }.Insert();
                            }
                            catch
                            {
                            }
                        }
                    }
                }
                this.LoadFocusedData();
            };
            this.splitContainerControl1.Panel2.Controls.Add(this.xucSelect);
            this.xucSelect.BringToFront();
        }

        private void Change()
        {
            if (MyRule.IsAccess("bbiReward"))
            {
                HRM_REWARD item = new HRM_REWARD();
                object focusedRowCellValue = this.gbList.GetFocusedRowCellValue("RewardCode");
                if (focusedRowCellValue != null)
                {
                    base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                    if (item.Get(focusedRowCellValue.ToString()) != "OK")
                    {
                        this.DoHide();
                        XtraMessageBox.Show("Dữ liệu kh\x00f4ng tồn tại", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        this.DoHide();
                        xfmRewardAdd add = new xfmRewardAdd(Actions.Update, item);
                        add.Updated += new xfmRewardAdd.UpdatedEventHander(this.frm_Updated);
                        add.Added += new xfmRewardAdd.AddedEventHander(this.frm_Added);
                        add.ShowDialog();
                    }
                }
            }
        }

        public void DisableMenu(bool disable)
        {
            this.bbiEdit.Enabled = !disable;
            this.bbiDelete.Enabled = !disable;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        protected void DoShowMenu(GridHitInfo hi)
        {
        }

        private void frm_Added(object sender, HRM_REWARD Item)
        {
            this.AddRow(Item);
        }

        private void frm_Updated(object sender, HRM_REWARD Item)
        {
            this.UpdateRow(Item);
        }

        private void gbList_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            if (e.RowHandle == -2147483648)
            {
                e.Handled = true;
                e.Painter.DrawObject(e.Info);
                Rectangle bounds = e.Bounds;
                e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(0x3f, 0xa5, 0xa5, 0)), bounds);
                bounds.Height--;
                bounds.Width--;
                e.Graphics.DrawRectangle(Pens.Blue, bounds);
            }
            int rowHandle = e.RowHandle;
            if (rowHandle >= 0)
            {
                rowHandle++;
                e.Info.DisplayText = rowHandle.ToString();
            }
        }

        private void gbList_DoubleClick(object sender, EventArgs e)
        {
            if (this.gbList.RowCount != 0)
            {
                this.Change();
            }
        }

        private void gbList_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            this.LoadFocusedData();
        }

        private void gbList_KeyDown(object sender, KeyEventArgs e)
        {
            this.ucList_ListKeyDown(sender, e);
            if ((e.KeyCode == Keys.Delete) && (this.gbList.RowCount != 0))
            {
                this.Delete();
                this.SetMenu(null);
            }
        }

        private void gbList_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.DoShowMenu(this.gbList.CalcHitInfo(new Point(e.X, e.Y)));
            }
            this.SetMenu(null);
        }

        private void gbList_RowCellClick(object sender, RowCellClickEventArgs e)
        {
            Common.Class.RowClickEventArgs args = new Common.Class.RowClickEventArgs(e.RowHandle, e.Column.ColumnHandle);
            this.SetMenu(args);
        }

        private string GetCode(ImageListBoxItem item)
        {
            try
            {
                string str = item.Value.ToString();
                char[] separator = new char[] { '(', ')' };
                return str.Split(separator)[1];
            }
            catch
            {
                return "";
            }
        }

        private void InitData()
        {
            System.DateTime now;
            try
            {
                now = DateAndTime.DateAdd(DateInterval.Month, -3.0, System.DateTime.Now);
            }
            catch
            {
                now = System.DateTime.Now;
            }
            this.bbeBeginDate.EditValue = now;
            this.bbeEndDate.EditValue = System.DateTime.Now;
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucReward));
            StyleFormatCondition condition = new StyleFormatCondition();
            StyleFormatCondition condition2 = new StyleFormatCondition();
            this.colStatus = new GridColumn();
            this.repStatus = new RepositoryItemImageComboBox();
            this.rptPhoto = new RepositoryItemPictureEdit();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.gridColumn3 = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.gridColumn5 = new GridColumn();
            this.gridColumn6 = new GridColumn();
            this.gridColumn7 = new GridColumn();
            this.gridColumn8 = new GridColumn();
            this.gridColumn9 = new GridColumn();
            this.gridColumn10 = new GridColumn();
            this.gridColumn11 = new GridColumn();
            this.gridColumn12 = new GridColumn();
            this.gridColumn13 = new GridColumn();
            this.gridColumn14 = new GridColumn();
            this.gridColumn15 = new GridColumn();
            this.gridColumn16 = new GridColumn();
            this.gridColumn17 = new GridColumn();
            this.gridColumn18 = new GridColumn();
            this.gridColumn19 = new GridColumn();
            this.gridColumn20 = new GridColumn();
            this.barManager1 = new BarManager(this.components);
            this.bar1 = new Bar();
            this.bbiAddEmployee = new BarButtonItem();
            this.bbiEdit = new BarButtonItem();
            this.bbiDelete = new BarButtonItem();
            this.bbiFilter = new BarEditItem();
            this.repositoryItemImageComboBox1 = new RepositoryItemImageComboBox();
            this.bbeBeginDate = new BarEditItem();
            this.repBeginDate = new RepositoryItemDateEdit();
            this.bbeEndDate = new BarEditItem();
            this.repEndDate = new RepositoryItemDateEdit();
            this.bbiPrint = new BarButtonItem();
            this.bbiExport = new BarButtonItem();
            this.bbiRefresh = new BarButtonItem();
            this.bbiClose = new BarButtonItem();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.imageCollection2 = new DevExpress.Utils.ImageCollection(this.components);
            this.layoutControl1 = new LayoutControl();
            this.imglsEmployee = new ImageListBoxControl();
            this.imgList = new DevExpress.Utils.ImageCollection(this.components);
            this.mmDescription = new MemoEdit();
            this.panelControl1 = new PanelControl();
            this.bbiDeleteEmployee = new SimpleButton();
            this.bbiSelect = new SimpleButton();
            this.layoutControlGroup1 = new LayoutControlGroup();
            this.layoutControlItem2 = new LayoutControlItem();
            this.layoutControlItem3 = new LayoutControlItem();
            this.layoutControlItem1 = new LayoutControlItem();
            this.splitContainerControl1 = new SplitContainerControl();
            this.gcList = new GridControl();
            this.gbList = new GridView();
            this.colRewardCode = new GridColumn();
            this.colFoundation = new GridColumn();
            this.colReason = new GridColumn();
            this.colObject = new GridColumn();
            this.colForm = new GridColumn();
            this.colLevel = new GridColumn();
            this.colSource = new GridColumn();
            this.colTotalValue = new GridColumn();
            this.repCal = new RepositoryItemCalcEdit();
            this.colDate = new GridColumn();
            this.colDecideNumber = new GridColumn();
            this.colDecideDate = new GridColumn();
            this.colPerson = new GridColumn();
            this.repStatus.BeginInit();
            this.rptPhoto.BeginInit();
            this.barManager1.BeginInit();
            this.repositoryItemImageComboBox1.BeginInit();
            this.repBeginDate.BeginInit();
            this.repBeginDate.VistaTimeProperties.BeginInit();
            this.repEndDate.BeginInit();
            this.repEndDate.VistaTimeProperties.BeginInit();
            this.imageCollection2.BeginInit();
            this.layoutControl1.BeginInit();
            this.layoutControl1.SuspendLayout();
            ((ISupportInitialize) this.imglsEmployee).BeginInit();
            this.imgList.BeginInit();
            this.mmDescription.Properties.BeginInit();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            this.layoutControlGroup1.BeginInit();
            this.layoutControlItem2.BeginInit();
            this.layoutControlItem3.BeginInit();
            this.layoutControlItem1.BeginInit();
            this.splitContainerControl1.BeginInit();
            this.splitContainerControl1.SuspendLayout();
            this.gcList.BeginInit();
            this.gbList.BeginInit();
            this.repCal.BeginInit();
            base.SuspendLayout();
            this.colStatus.Caption = "Trạng th\x00e1i";
            this.colStatus.ColumnEdit = this.repStatus;
            this.colStatus.FieldName = "Status";
            this.colStatus.Name = "colStatus";
            this.colStatus.OptionsColumn.AllowEdit = false;
            this.colStatus.OptionsColumn.ReadOnly = true;
            this.colStatus.Visible = true;
            this.colStatus.VisibleIndex = 8;
            this.repStatus.AutoHeight = false;
            this.repStatus.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repStatus.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("L\x00ean kế hoạch", 0, -1), new ImageComboBoxItem("Đang thực hiện", 1, -1), new ImageComboBoxItem("Đ\x00e3 thực hiện", 2, -1) });
            this.repStatus.Name = "repStatus";
            this.rptPhoto.CustomHeight = 0x30;
            this.rptPhoto.Name = "rptPhoto";
            this.rptPhoto.NullText = "[Chưa chọn h\x00ecnh]";
            this.rptPhoto.SizeMode = PictureSizeMode.Zoom;
            this.gridColumn1.Caption = "Chi nh\x00e1nh";
            this.gridColumn1.FieldName = "BranchName";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn2.Caption = "Ph\x00f2ng ban";
            this.gridColumn2.FieldName = "DepartmentName";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.gridColumn3.Caption = "Tổ nh\x00f3m";
            this.gridColumn3.FieldName = "GroupName";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 2;
            this.gridColumn4.Caption = "H\x00ecnh ảnh";
            this.gridColumn4.ColumnEdit = this.rptPhoto;
            this.gridColumn4.FieldName = "Photo";
            this.gridColumn4.Fixed = FixedStyle.Left;
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.OptionsColumn.AllowEdit = false;
            this.gridColumn4.OptionsColumn.ReadOnly = true;
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 3;
            this.gridColumn5.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.gridColumn5.FieldName = "EmployeeCode";
            this.gridColumn5.Fixed = FixedStyle.Left;
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.OptionsColumn.AllowEdit = false;
            this.gridColumn5.OptionsColumn.ReadOnly = true;
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 4;
            this.gridColumn5.Width = 0x4a;
            this.gridColumn6.Caption = "Họ l\x00f3t";
            this.gridColumn6.FieldName = "FirstName";
            this.gridColumn6.Fixed = FixedStyle.Left;
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.OptionsColumn.AllowEdit = false;
            this.gridColumn6.OptionsColumn.ReadOnly = true;
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 5;
            this.gridColumn6.Width = 110;
            this.gridColumn7.Caption = "T\x00ean";
            this.gridColumn7.FieldName = "LastName";
            this.gridColumn7.Fixed = FixedStyle.Left;
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.OptionsColumn.AllowEdit = false;
            this.gridColumn7.OptionsColumn.ReadOnly = true;
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 6;
            this.gridColumn7.Width = 0x42;
            this.gridColumn8.Caption = "Giới t\x00ednh";
            this.gridColumn8.FieldName = "Sex";
            this.gridColumn8.Name = "gridColumn8";
            this.gridColumn8.OptionsColumn.AllowEdit = false;
            this.gridColumn8.OptionsColumn.ReadOnly = true;
            this.gridColumn8.Visible = true;
            this.gridColumn8.VisibleIndex = 7;
            this.gridColumn8.Width = 0x38;
            this.gridColumn9.Caption = "Ng\x00e0y sinh";
            this.gridColumn9.FieldName = "Birthday";
            this.gridColumn9.Name = "gridColumn9";
            this.gridColumn9.OptionsColumn.AllowEdit = false;
            this.gridColumn9.OptionsColumn.ReadOnly = true;
            this.gridColumn9.Visible = true;
            this.gridColumn9.VisibleIndex = 8;
            this.gridColumn9.Width = 0x42;
            this.gridColumn10.Caption = "Nơi sinh";
            this.gridColumn10.FieldName = "BirthPlace";
            this.gridColumn10.Name = "gridColumn10";
            this.gridColumn10.OptionsColumn.AllowEdit = false;
            this.gridColumn10.OptionsColumn.ReadOnly = true;
            this.gridColumn10.Visible = true;
            this.gridColumn10.VisibleIndex = 9;
            this.gridColumn10.Width = 0x6f;
            this.gridColumn11.Caption = "Điện thoại";
            this.gridColumn11.FieldName = "CellPhone";
            this.gridColumn11.Name = "gridColumn11";
            this.gridColumn11.OptionsColumn.AllowEdit = false;
            this.gridColumn11.OptionsColumn.ReadOnly = true;
            this.gridColumn11.Visible = true;
            this.gridColumn11.VisibleIndex = 10;
            this.gridColumn11.Width = 0x53;
            this.gridColumn12.Caption = "Địa chỉ";
            this.gridColumn12.FieldName = "MainAddress";
            this.gridColumn12.Name = "gridColumn12";
            this.gridColumn12.OptionsColumn.AllowEdit = false;
            this.gridColumn12.OptionsColumn.ReadOnly = true;
            this.gridColumn12.Visible = true;
            this.gridColumn12.VisibleIndex = 11;
            this.gridColumn12.Width = 0x13f;
            this.gridColumn13.Caption = "Chức vụ";
            this.gridColumn13.FieldName = "Position";
            this.gridColumn13.Name = "gridColumn13";
            this.gridColumn13.OptionsColumn.AllowEdit = false;
            this.gridColumn13.Visible = true;
            this.gridColumn13.VisibleIndex = 12;
            this.gridColumn13.Width = 0x8b;
            this.gridColumn14.Caption = "CMND";
            this.gridColumn14.FieldName = "IDCard";
            this.gridColumn14.Name = "gridColumn14";
            this.gridColumn14.OptionsColumn.AllowEdit = false;
            this.gridColumn14.OptionsColumn.ReadOnly = true;
            this.gridColumn14.Visible = true;
            this.gridColumn14.VisibleIndex = 13;
            this.gridColumn14.Width = 0x54;
            this.gridColumn15.Caption = "Ng\x00e0y cấp";
            this.gridColumn15.FieldName = "IDCardDate";
            this.gridColumn15.Name = "gridColumn15";
            this.gridColumn15.OptionsColumn.AllowEdit = false;
            this.gridColumn15.OptionsColumn.ReadOnly = true;
            this.gridColumn15.Visible = true;
            this.gridColumn15.VisibleIndex = 14;
            this.gridColumn16.Caption = "Nơi cấp";
            this.gridColumn16.FieldName = "IDCardPlace";
            this.gridColumn16.Name = "gridColumn16";
            this.gridColumn16.OptionsColumn.AllowEdit = false;
            this.gridColumn16.OptionsColumn.ReadOnly = true;
            this.gridColumn16.Visible = true;
            this.gridColumn16.VisibleIndex = 15;
            this.gridColumn16.Width = 0x73;
            this.gridColumn17.Caption = "Trạng th\x00e1i";
            this.gridColumn17.FieldName = "Status";
            this.gridColumn17.Name = "gridColumn17";
            this.gridColumn17.OptionsColumn.AllowEdit = false;
            this.gridColumn17.OptionsColumn.ReadOnly = true;
            this.gridColumn17.Visible = true;
            this.gridColumn17.VisibleIndex = 0x10;
            this.gridColumn18.Caption = "Ng\x00e0y BD thử việc";
            this.gridColumn18.FieldName = "TestFromDate";
            this.gridColumn18.Name = "gridColumn18";
            this.gridColumn18.OptionsColumn.AllowEdit = false;
            this.gridColumn18.OptionsColumn.ReadOnly = true;
            this.gridColumn18.Visible = true;
            this.gridColumn18.VisibleIndex = 0x11;
            this.gridColumn19.Caption = "Ng\x00e0y KT thử việc";
            this.gridColumn19.FieldName = "TestToDate";
            this.gridColumn19.Name = "gridColumn19";
            this.gridColumn19.OptionsColumn.AllowEdit = false;
            this.gridColumn19.OptionsColumn.ReadOnly = true;
            this.gridColumn19.Visible = true;
            this.gridColumn19.VisibleIndex = 0x12;
            this.gridColumn20.Caption = "Ng\x00e0y nghỉ";
            this.gridColumn20.FieldName = "EndDate";
            this.gridColumn20.Name = "gridColumn20";
            this.gridColumn20.OptionsColumn.AllowEdit = false;
            this.gridColumn20.OptionsColumn.ReadOnly = true;
            this.gridColumn20.Visible = true;
            this.gridColumn20.VisibleIndex = 0x13;
            this.barManager1.Bars.AddRange(new Bar[] { this.bar1 });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Images = this.imageCollection2;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiAddEmployee, this.bbiEdit, this.bbiDelete, this.bbiPrint, this.bbiRefresh, this.bbiClose, this.bbiExport, this.bbiFilter, this.bbeBeginDate, this.bbeEndDate });
            this.barManager1.MaxItemId = 0x20;
            this.barManager1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox1, this.repBeginDate, this.repEndDate });
            this.bar1.BarName = "Tools";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = BarDockStyle.Top;
            this.bar1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiAddEmployee, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiEdit, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiDelete, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiFilter, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbeBeginDate, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbeEndDate, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiPrint, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiExport, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiRefresh, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiClose, BarItemPaintStyle.CaptionGlyph) });
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Tools";
            this.bbiAddEmployee.Caption = "Th\x00eam Đợt Khen Thưởng";
            this.bbiAddEmployee.Id = 3;
            this.bbiAddEmployee.ImageIndex = 0x42;
            this.bbiAddEmployee.Name = "bbiAddEmployee";
            this.bbiAddEmployee.ItemClick += new ItemClickEventHandler(this.bbiAddWork_ItemClick);
            this.bbiEdit.Caption = "Sửa";
            this.bbiEdit.Id = 4;
            this.bbiEdit.ImageIndex = 14;
            this.bbiEdit.Name = "bbiEdit";
            this.bbiEdit.ItemClick += new ItemClickEventHandler(this.bbiEdit_ItemClick);
            this.bbiDelete.Caption = "X\x00f3a";
            this.bbiDelete.Id = 5;
            this.bbiDelete.ImageIndex = 13;
            this.bbiDelete.Name = "bbiDelete";
            this.bbiDelete.ItemClick += new ItemClickEventHandler(this.bbiDelete_ItemClick);
            this.bbiFilter.Caption = "Lọc:";
            this.bbiFilter.Edit = this.repositoryItemImageComboBox1;
            this.bbiFilter.Id = 10;
            this.bbiFilter.Name = "bbiFilter";
            this.bbiFilter.Width = 120;
            this.repositoryItemImageComboBox1.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repositoryItemImageComboBox1.Appearance.Options.UseFont = true;
            this.repositoryItemImageComboBox1.AutoHeight = false;
            this.repositoryItemImageComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox1.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("<Tất cả>", 0, -1), new ImageComboBoxItem("<Theo thời gian>", 1, -1) });
            this.repositoryItemImageComboBox1.Name = "repositoryItemImageComboBox1";
            this.bbeBeginDate.Caption = "Từ ng\x00e0y:";
            this.bbeBeginDate.Edit = this.repBeginDate;
            this.bbeBeginDate.Enabled = false;
            this.bbeBeginDate.Id = 30;
            this.bbeBeginDate.Name = "bbeBeginDate";
            this.bbeBeginDate.Width = 80;
            this.repBeginDate.AutoHeight = false;
            this.repBeginDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repBeginDate.Name = "repBeginDate";
            this.repBeginDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbeEndDate.Caption = "Đến ng\x00e0y:";
            this.bbeEndDate.Edit = this.repEndDate;
            this.bbeEndDate.Enabled = false;
            this.bbeEndDate.Id = 0x1f;
            this.bbeEndDate.Name = "bbeEndDate";
            this.bbeEndDate.Width = 80;
            this.repEndDate.AutoHeight = false;
            this.repEndDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repEndDate.Name = "repEndDate";
            this.repEndDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbiPrint.Caption = "In";
            this.bbiPrint.Id = 6;
            this.bbiPrint.ImageIndex = 9;
            this.bbiPrint.Name = "bbiPrint";
            this.bbiPrint.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiExport.Caption = "Xuất";
            this.bbiExport.Id = 9;
            this.bbiExport.ImageIndex = 0x31;
            this.bbiExport.Name = "bbiExport";
            this.bbiExport.ItemClick += new ItemClickEventHandler(this.bbiExport_ItemClick);
            this.bbiRefresh.Caption = "Nạp Lại";
            this.bbiRefresh.Id = 7;
            this.bbiRefresh.ImageIndex = 0x2a;
            this.bbiRefresh.Name = "bbiRefresh";
            this.bbiRefresh.ItemClick += new ItemClickEventHandler(this.bbiRefresh_ItemClick);
            this.bbiClose.Caption = "Đ\x00f3ng";
            this.bbiClose.Id = 8;
            this.bbiClose.ImageIndex = 0x16;
            this.bbiClose.Name = "bbiClose";
            this.bbiClose.ItemClick += new ItemClickEventHandler(this.bbiClose_ItemClick);
            this.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.imageCollection2.Images.SetKeyName(0x3d, "Vista (35).ico");
            this.imageCollection2.Images.SetKeyName(0x3e, "Security.ico");
            this.imageCollection2.Images.SetKeyName(0x3f, "RibbonPrintPreview_DocumentMapLarge.png");
            this.imageCollection2.Images.SetKeyName(0x40, "11.png");
            this.imageCollection2.Images.SetKeyName(0x41, "Sua.png");
            this.imageCollection2.Images.SetKeyName(0x42, "Them.png");
            this.imageCollection2.Images.SetKeyName(0x43, "PhanQuyen.png");
            this.imageCollection2.Images.SetKeyName(0x44, "11.png");
            this.imageCollection2.Images.SetKeyName(0x45, "plus.png");
            this.layoutControl1.Controls.Add(this.imglsEmployee);
            this.layoutControl1.Controls.Add(this.mmDescription);
            this.layoutControl1.Controls.Add(this.panelControl1);
            this.layoutControl1.Dock = DockStyle.Fill;
            this.layoutControl1.Location = new Point(0, 0);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroup1;
            this.layoutControl1.Size = new Size(0xfe, 0x255);
            this.layoutControl1.TabIndex = 4;
            this.layoutControl1.Text = "layoutControl1";
            this.imglsEmployee.HighlightedItemStyle = HighlightStyle.Skinned;
            this.imglsEmployee.ImageList = this.imgList;
            this.imglsEmployee.Location = new Point(4, 0x11a);
            this.imglsEmployee.Name = "imglsEmployee";
            this.imglsEmployee.Size = new Size(0xf6, 0x10f);
            this.imglsEmployee.StyleController = this.layoutControl1;
            this.imglsEmployee.TabIndex = 7;
            this.imgList.ImageStream = (ImageCollectionStreamer) manager.GetObject("imgList.ImageStream");
            this.imgList.Images.SetKeyName(0, "male.png");
            this.imgList.Images.SetKeyName(1, "user_woman.png");
            this.mmDescription.Location = new Point(4, 0x15);
            this.mmDescription.MenuManager = this.barManager1;
            this.mmDescription.Name = "mmDescription";
            this.mmDescription.Properties.ReadOnly = true;
            this.mmDescription.Size = new Size(0xf6, 240);
            this.mmDescription.StyleController = this.layoutControl1;
            this.mmDescription.TabIndex = 4;
            this.panelControl1.BorderStyle = BorderStyles.NoBorder;
            this.panelControl1.Controls.Add(this.bbiDeleteEmployee);
            this.panelControl1.Controls.Add(this.bbiSelect);
            this.panelControl1.Location = new Point(4, 0x22d);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Size = new Size(0xf6, 0x24);
            this.panelControl1.TabIndex = 6;
            this.bbiDeleteEmployee.ImageIndex = 13;
            this.bbiDeleteEmployee.ImageList = this.imageCollection2;
            this.bbiDeleteEmployee.Location = new Point(0x5d, 6);
            this.bbiDeleteEmployee.Name = "bbiDeleteEmployee";
            this.bbiDeleteEmployee.Size = new Size(0x4b, 0x17);
            this.bbiDeleteEmployee.TabIndex = 1;
            this.bbiDeleteEmployee.Text = "X\x00f3a";
            this.bbiDeleteEmployee.Click += new EventHandler(this.bbiDeleteEmployee_Click);
            this.bbiSelect.ImageIndex = 0x27;
            this.bbiSelect.ImageList = this.imageCollection2;
            this.bbiSelect.Location = new Point(8, 6);
            this.bbiSelect.Name = "bbiSelect";
            this.bbiSelect.Size = new Size(0x4b, 0x17);
            this.bbiSelect.TabIndex = 0;
            this.bbiSelect.Text = "Chọn ...";
            this.bbiSelect.Click += new EventHandler(this.bbiSelect_Click);
            this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.True;
            this.layoutControlGroup1.GroupBordersVisible = false;
            this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem2, this.layoutControlItem3, this.layoutControlItem1 });
            this.layoutControlGroup1.Location = new Point(0, 0);
            this.layoutControlGroup1.Name = "layoutControlGroup1";
            this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
            this.layoutControlGroup1.Size = new Size(0xfe, 0x255);
            this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup1.Text = "layoutControlGroup1";
            this.layoutControlGroup1.TextVisible = false;
            this.layoutControlItem2.AllowHtmlStringInCaption = true;
            this.layoutControlItem2.Control = this.mmDescription;
            this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
            this.layoutControlItem2.Location = new Point(0, 0);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Size = new Size(250, 0x105);
            this.layoutControlItem2.Text = "<b>Th\x00f4ng tin li\x00ean quan:</b>";
            this.layoutControlItem2.TextLocation = Locations.Top;
            this.layoutControlItem2.TextSize = new Size(180, 14);
            this.layoutControlItem3.Control = this.panelControl1;
            this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
            this.layoutControlItem3.Location = new Point(0, 0x229);
            this.layoutControlItem3.MaxSize = new Size(0, 40);
            this.layoutControlItem3.MinSize = new Size(0x68, 40);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.Size = new Size(250, 40);
            this.layoutControlItem3.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlItem3.Text = "layoutControlItem3";
            this.layoutControlItem3.TextAlignMode = TextAlignModeItem.CustomSize;
            this.layoutControlItem3.TextSize = new Size(0, 0);
            this.layoutControlItem3.TextToControlDistance = 0;
            this.layoutControlItem3.TextVisible = false;
            this.layoutControlItem1.AllowHtmlStringInCaption = true;
            this.layoutControlItem1.Control = this.imglsEmployee;
            this.layoutControlItem1.CustomizationFormText = "<b>Những người được khen thưởng:</b>";
            this.layoutControlItem1.Location = new Point(0, 0x105);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.Size = new Size(250, 0x124);
            this.layoutControlItem1.Text = "<b>Những người được khen thưởng:</b>";
            this.layoutControlItem1.TextLocation = Locations.Top;
            this.layoutControlItem1.TextSize = new Size(180, 14);
            this.splitContainerControl1.Dock = DockStyle.Fill;
            this.splitContainerControl1.FixedPanel = SplitFixedPanel.Panel2;
            this.splitContainerControl1.Location = new Point(0, 0x1a);
            this.splitContainerControl1.Name = "splitContainerControl1";
            this.splitContainerControl1.Panel1.Controls.Add(this.gcList);
            this.splitContainerControl1.Panel1.Text = "Panel1";
            this.splitContainerControl1.Panel2.Controls.Add(this.layoutControl1);
            this.splitContainerControl1.Panel2.Text = "Panel2";
            this.splitContainerControl1.Size = new Size(0x3d9, 0x255);
            this.splitContainerControl1.SplitterPosition = 0xfe;
            this.splitContainerControl1.TabIndex = 5;
            this.splitContainerControl1.Text = "splitContainerControl1";
            this.gcList.Dock = DockStyle.Fill;
            this.gcList.EmbeddedNavigator.Buttons.Append.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Remove.Visible = false;
            this.gcList.EmbeddedNavigator.TextStringFormat = "{0}/{1}";
            this.gcList.Location = new Point(0, 0);
            this.gcList.MainView = this.gbList;
            this.gcList.Name = "gcList";
            this.gcList.RepositoryItems.AddRange(new RepositoryItem[] { this.repCal, this.repStatus });
            this.gcList.Size = new Size(0x2d5, 0x255);
            this.gcList.TabIndex = 3;
            this.gcList.UseEmbeddedNavigator = true;
            this.gcList.ViewCollection.AddRange(new BaseView[] { this.gbList });
            this.gbList.Appearance.GroupRow.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.gbList.Appearance.GroupRow.Options.UseFont = true;
            this.gbList.Appearance.HeaderPanel.Options.UseFont = true;
            this.gbList.Appearance.HeaderPanel.Options.UseImage = true;
            this.gbList.Appearance.HeaderPanel.Options.UseTextOptions = true;
            this.gbList.Appearance.HeaderPanel.TextOptions.HAlignment = HorzAlignment.Center;
            this.gbList.Appearance.HeaderPanel.TextOptions.WordWrap = WordWrap.Wrap;
            this.gbList.BorderStyle = BorderStyles.NoBorder;
            this.gbList.ColumnPanelRowHeight = 0x20;
            this.gbList.Columns.AddRange(new GridColumn[] { this.colRewardCode, this.colFoundation, this.colReason, this.colObject, this.colForm, this.colLevel, this.colSource, this.colTotalValue, this.colStatus, this.colDate, this.colDecideNumber, this.colDecideDate, this.colPerson });
            condition.Appearance.ForeColor = Color.Green;
            condition.Appearance.Options.UseForeColor = true;
            condition.ApplyToRow = true;
            condition.Column = this.colStatus;
            condition.Condition = FormatConditionEnum.Expression;
            condition.Expression = "[Status] == 0";
            condition2.Appearance.ForeColor = Color.Blue;
            condition2.Appearance.Options.UseForeColor = true;
            condition2.ApplyToRow = true;
            condition2.Column = this.colStatus;
            condition2.Condition = FormatConditionEnum.Expression;
            condition2.Expression = "[Status] == 1";
            this.gbList.FormatConditions.AddRange(new StyleFormatCondition[] { condition, condition2 });
            this.gbList.GridControl = this.gcList;
            this.gbList.GroupPanelText = "K\x00e9o v\x00e0 thả cột v\x00e0o đ\x00e2y để nh\x00f3m dữ liệu";
            this.gbList.IndicatorWidth = 40;
            this.gbList.Name = "gbList";
            this.gbList.OptionsBehavior.AllowIncrementalSearch = true;
            this.gbList.OptionsBehavior.AutoExpandAllGroups = true;
            this.gbList.OptionsBehavior.CopyToClipboardWithColumnHeaders = false;
            this.gbList.OptionsBehavior.FocusLeaveOnTab = true;
            this.gbList.OptionsLayout.StoreAllOptions = true;
            this.gbList.OptionsLayout.StoreAppearance = true;
            this.gbList.OptionsMenu.EnableColumnMenu = false;
            this.gbList.OptionsMenu.EnableGroupPanelMenu = false;
            this.gbList.OptionsNavigation.EnterMoveNextColumn = true;
            this.gbList.OptionsSelection.InvertSelection = true;
            this.gbList.OptionsSelection.MultiSelect = true;
            this.gbList.OptionsView.AnimationType = GridAnimationType.AnimateFocusedItem;
            this.gbList.OptionsView.ColumnAutoWidth = false;
            this.gbList.OptionsView.RowAutoHeight = true;
            this.gbList.OptionsView.ShowAutoFilterRow = true;
            this.gbList.FocusedRowChanged += new FocusedRowChangedEventHandler(this.gbList_FocusedRowChanged);
            this.gbList.CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(this.gbList_CustomDrawRowIndicator);
            this.gbList.KeyDown += new KeyEventHandler(this.gbList_KeyDown);
            this.gbList.MouseDown += new MouseEventHandler(this.gbList_MouseDown);
            this.gbList.DoubleClick += new EventHandler(this.gbList_DoubleClick);
            this.gbList.RowCellClick += new RowCellClickEventHandler(this.gbList_RowCellClick);
            this.colRewardCode.Caption = "M\x00e3 đợt";
            this.colRewardCode.FieldName = "RewardCode";
            this.colRewardCode.Name = "colRewardCode";
            this.colRewardCode.OptionsColumn.AllowEdit = false;
            this.colRewardCode.OptionsColumn.ReadOnly = true;
            this.colRewardCode.Visible = true;
            this.colRewardCode.VisibleIndex = 0;
            this.colFoundation.Caption = "Căn cứ khen thưởng";
            this.colFoundation.FieldName = "Foundation";
            this.colFoundation.Name = "colFoundation";
            this.colFoundation.OptionsColumn.AllowEdit = false;
            this.colFoundation.OptionsColumn.ReadOnly = true;
            this.colFoundation.Visible = true;
            this.colFoundation.VisibleIndex = 1;
            this.colFoundation.Width = 0x85;
            this.colReason.Caption = "L\x00fd do";
            this.colReason.FieldName = "Reason";
            this.colReason.Name = "colReason";
            this.colReason.OptionsColumn.AllowEdit = false;
            this.colReason.OptionsColumn.ReadOnly = true;
            this.colReason.Visible = true;
            this.colReason.VisibleIndex = 2;
            this.colReason.Width = 0xb5;
            this.colObject.Caption = "Đối tượng khen thưởng";
            this.colObject.FieldName = "Object";
            this.colObject.Name = "colObject";
            this.colObject.OptionsColumn.AllowEdit = false;
            this.colObject.OptionsColumn.ReadOnly = true;
            this.colObject.Visible = true;
            this.colObject.VisibleIndex = 3;
            this.colObject.Width = 0x9f;
            this.colForm.Caption = "H\x00ecnh thức khen thưởng";
            this.colForm.FieldName = "Form";
            this.colForm.Name = "colForm";
            this.colForm.OptionsColumn.AllowEdit = false;
            this.colForm.OptionsColumn.ReadOnly = true;
            this.colForm.Visible = true;
            this.colForm.VisibleIndex = 4;
            this.colLevel.Caption = "Cấp khen thưởng";
            this.colLevel.FieldName = "Level";
            this.colLevel.Name = "colLevel";
            this.colLevel.Visible = true;
            this.colLevel.VisibleIndex = 5;
            this.colSource.Caption = "Nguồn khen thưởng";
            this.colSource.FieldName = "Source";
            this.colSource.Name = "colSource";
            this.colSource.OptionsColumn.AllowEdit = false;
            this.colSource.OptionsColumn.ReadOnly = true;
            this.colSource.Visible = true;
            this.colSource.VisibleIndex = 6;
            this.colTotalValue.Caption = "Tổng gi\x00e1 trị";
            this.colTotalValue.ColumnEdit = this.repCal;
            this.colTotalValue.FieldName = "TotalValue";
            this.colTotalValue.Name = "colTotalValue";
            this.colTotalValue.OptionsColumn.AllowEdit = false;
            this.colTotalValue.OptionsColumn.ReadOnly = true;
            this.colTotalValue.Visible = true;
            this.colTotalValue.VisibleIndex = 7;
            this.repCal.AutoHeight = false;
            this.repCal.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repCal.Mask.UseMaskAsDisplayFormat = true;
            this.repCal.Name = "repCal";
            this.colDate.Caption = "Ng\x00e0y khen thưởng";
            this.colDate.FieldName = "Date";
            this.colDate.Name = "colDate";
            this.colDate.Visible = true;
            this.colDate.VisibleIndex = 9;
            this.colDecideNumber.Caption = "Số quyết định";
            this.colDecideNumber.FieldName = "DecideNumber";
            this.colDecideNumber.Name = "colDecideNumber";
            this.colDecideNumber.Visible = true;
            this.colDecideNumber.VisibleIndex = 10;
            this.colDecideDate.Caption = "Ng\x00e0y quyết định";
            this.colDecideDate.FieldName = "DecideDate";
            this.colDecideDate.Name = "colDecideDate";
            this.colDecideDate.Visible = true;
            this.colDecideDate.VisibleIndex = 11;
            this.colPerson.Caption = "Người quyết định";
            this.colPerson.FieldName = "Person";
            this.colPerson.Name = "colPerson";
            this.colPerson.Visible = true;
            this.colPerson.VisibleIndex = 12;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.splitContainerControl1);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xucReward";
            base.Size = new Size(0x3d9, 0x26f);
            this.repStatus.EndInit();
            this.rptPhoto.EndInit();
            this.barManager1.EndInit();
            this.repositoryItemImageComboBox1.EndInit();
            this.repBeginDate.VistaTimeProperties.EndInit();
            this.repBeginDate.EndInit();
            this.repEndDate.VistaTimeProperties.EndInit();
            this.repEndDate.EndInit();
            this.imageCollection2.EndInit();
            this.layoutControl1.EndInit();
            this.layoutControl1.ResumeLayout(false);
            ((ISupportInitialize) this.imglsEmployee).EndInit();
            this.imgList.EndInit();
            this.mmDescription.Properties.EndInit();
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            this.layoutControlGroup1.EndInit();
            this.layoutControlItem2.EndInit();
            this.layoutControlItem3.EndInit();
            this.layoutControlItem1.EndInit();
            this.splitContainerControl1.EndInit();
            this.splitContainerControl1.ResumeLayout(false);
            this.gcList.EndInit();
            this.gbList.EndInit();
            this.repCal.EndInit();
            base.ResumeLayout(false);
        }

        private void LoadFocusedData()
        {
            try
            {
                this.mmDescription.Text = "Căn cứ khen thưởng:" + Environment.NewLine + this.gbList.GetFocusedRowCellValue(this.colFoundation).ToString() + Environment.NewLine + Environment.NewLine + "L\x00fd do khen thưởng:" + Environment.NewLine + this.gbList.GetFocusedRowCellValue(this.colReason).ToString() + Environment.NewLine + Environment.NewLine + "Đối tượng khen thưởng:" + Environment.NewLine + this.gbList.GetFocusedRowCellValue(this.colObject).ToString() + Environment.NewLine + Environment.NewLine + "H\x00ecnh thức khen thưởng:" + Environment.NewLine + this.gbList.GetFocusedRowCellValue(this.colForm).ToString();
                this.imglsEmployee.Items.Clear();
                this.m_RewardCode = this.gbList.GetFocusedRowCellValue(this.colRewardCode).ToString();
                HRM_REWARD_EMPLOYEE hrm_reward_employee = new HRM_REWARD_EMPLOYEE();
                foreach (DataRow row in hrm_reward_employee.GetList(this.m_RewardCode).Rows)
                {
                    if (row["Sex"].ToString() == "False")
                    {
                        this.imglsEmployee.Items.Add(row["FirstName"].ToString() + " " + row["LastName"].ToString() + " (" + row["EmployeeCode"].ToString() + ")", 1);
                    }
                    else
                    {
                        this.imglsEmployee.Items.Add(row["FirstName"].ToString() + " " + row["LastName"].ToString() + " (" + row["EmployeeCode"].ToString() + ")", 0);
                    }
                }
            }
            catch
            {
            }
            if (this.xucSelect != null)
            {
                this.splitContainerControl1.Panel2.Controls.Remove(this.xucSelect);
                this.xucSelect = null;
            }
        }

        private void LoadGrid()
        {
            HRM_REWARD hrm_reward = new HRM_REWARD();
            if (this.m_IndexKey == 0)
            {
                this.gcList.DataSource = hrm_reward.GetList();
            }
            else
            {
                this.gcList.DataSource = hrm_reward.GetListByDate(System.DateTime.Parse(this.bbeBeginDate.EditValue.ToString()), System.DateTime.Parse(this.bbeEndDate.EditValue.ToString()));
            }
        }

        private void RaiseClosedHander()
        {
            if (this.Closed != null)
            {
                this.Closed(this);
            }
        }

        private void ReLoad()
        {
            base.SetWaitDialogCaption("Đang nạp dữ liệu...");
            this.m_IndexKey = 0;
            this.bbiFilter.EditValue = 0;
            this.bbiFilter.EditValueChanged += new EventHandler(this.bbiFilter_EditValueChanged);
            this.bbeBeginDate.EditValueChanged += (s, e) => this.LoadGrid();
            this.bbeEndDate.EditValueChanged += (s, e) => this.LoadGrid();
            this.LoadGrid();
        }

        private void SetMenu(Common.Class.RowClickEventArgs e)
        {
            object rowCellValue = this.gbList.GetRowCellValue(this.gbList.FocusedRowHandle, "RewardCode");
            this.DisableMenu(false);
            if (rowCellValue == null)
            {
                this.DisableMenu(true);
            }
        }

        private void ucList_ListKeyDown(object sender, KeyEventArgs key)
        {
            if (key.KeyCode == Keys.F2)
            {
                if (this.gbList.RowCount != 0)
                {
                    this.Change();
                }
            }
            else if ((key.KeyCode == Keys.Control) | (key.KeyCode == Keys.E))
            {
                if (this.gbList.RowCount != 0)
                {
                    this.Change();
                }
            }
            else if (key.KeyCode == Keys.Enter)
            {
                if (this.gbList.RowCount != 0)
                {
                    this.Change();
                }
            }
            else if (key.KeyCode == Keys.F5)
            {
                this.ReLoad();
            }
            else if ((key.KeyCode == Keys.Control) | (key.KeyCode == Keys.N))
            {
                this.Add();
            }
            else if ((key.KeyCode == Keys.Control) | (key.KeyCode == Keys.T))
            {
                this.Add();
            }
        }

        private void UpdateRow(HRM_REWARD item)
        {
            GridView gbList = this.gbList;
            int focusedRowHandle = this.gbList.FocusedRowHandle;
            gbList.SetRowCellValue(focusedRowHandle, "RewardCode", item.RewardCode);
            gbList.SetRowCellValue(focusedRowHandle, "Foundation", item.Foundation);
            gbList.SetRowCellValue(focusedRowHandle, "Reason", item.Reason);
            gbList.SetRowCellValue(focusedRowHandle, "Object", item.Object);
            gbList.SetRowCellValue(focusedRowHandle, "Form", item.Form);
            gbList.SetRowCellValue(focusedRowHandle, "Level", item.Level);
            gbList.SetRowCellValue(focusedRowHandle, "Source", item.Source);
            gbList.SetRowCellValue(focusedRowHandle, "TotalValue", item.TotalValue);
            gbList.SetRowCellValue(focusedRowHandle, "Status", item.Status);
            gbList.SetRowCellValue(focusedRowHandle, "Date", item.Date);
            gbList.SetRowCellValue(focusedRowHandle, "DecideNumber", item.DecideNumber);
            gbList.SetRowCellValue(focusedRowHandle, "DecideDate", item.DecideDate);
            gbList.SetRowCellValue(focusedRowHandle, "Person", item.Person);
            gbList.UpdateCurrentRow();
        }

        public delegate void ClosedHander(object sender);
    }
}

